package com.lmt_9;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Consumer;

public class Movie {
    public static void main(String[] args) {
        Collection<Film> films = new ArrayList<>();
        films.add(new Film("肖申克的救赎", 9.7, "罗宾斯"));
        films.add(new Film("霸王别姬",9.6,"张国荣，张丰毅"));
        films.add(new Film("阿甘正传",9.5,"tom"));

        for (Film film : films) {
            System.out.println(film.getName());
            System.out.println(film.getScore());
            System.out.println(film.getActor());
        }
        films.forEach(new Consumer<Film>() {
            @Override
            public void accept(Film film) {
                System.out.println(film.getName());
                System.out.println(film.getScore());
                System.out.println(film.getActor());
            }
        });
    }
}
class Film{
    private String name;
    private double score;
    private String actor;

    public Film(String name, double score, String actor) {
        this.name = name;
        this.score = score;
        this.actor = actor;
    }

    public Film() {
    }

    public String getName() {
        return name;
    }

    public String getActor() {
        return actor;
    }

    public double getScore() {
        return score;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public void setActor(String actor) {
        this.actor = actor;
    }
}
